package com.mengxiang.itman.servlet;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class ServletConfig
 */
public class ServletConfig extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
  
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}


	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		javax.servlet.ServletConfig sc=getServletConfig();
		String name=sc.getInitParameter("name");
		String age=sc.getInitParameter("age");
		System.out.println("name:"+name+">>age"+age);
		System.out.println("11111111------------------------");
		name=getInitParameter("name");
		age=getInitParameter("age");
		System.out.println("name:"+name+">>age"+age);
		System.out.println("22222222------------------------");
		Enumeration<String> en =sc.getInitParameterNames();
		while(en.hasMoreElements()){
			String key=en.nextElement();
			String value=sc.getInitParameter(key);
			System.out.println("key:"+key+">>value"+value);
			System.out.println("33333333------------------------");
		}
	}

}
